package com.qq.weixin.mp.message.hxexp.model.receive;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.hxexp.weixin.common.jaxb.CDATAAdapter;

/**
 * 扫码事件
 * @author li.jiang
 *
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public final class ScanEventJaxb extends BaseMsgJaxb {

    private static final long serialVersionUID = 2030106232143374389L;
    /**
     * 事件类型
     */
    @XmlElement(name = "Event")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String event;
    /**
     * 事件KEY值，qrscene_为前缀，后面为二维码的参数值
     */
    @XmlElement(name = "EventKey")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String eventKey;
    /**
     * 二维码的ticket，可用来换取二维码图片
     */
    @XmlElement(name = "Ticket")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String ticket;
    /**
     * @return the event
     */
    public String getEvent() {
        return event;
    }
    /**
     * @param event the event to set
     */
    public void setEvent(String event) {
        this.event = event;
    }
    /**
     * @return the eventKey
     */
    public String getEventKey() {
        return eventKey;
    }
    /**
     * @param eventKey the eventKey to set
     */
    public void setEventKey(String eventKey) {
        this.eventKey = eventKey;
    }
    /**
     * @return the ticket
     */
    public String getTicket() {
        return ticket;
    }
    /**
     * @param ticket the ticket to set
     */
    public void setTicket(String ticket) {
        this.ticket = ticket;
    }
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return String
                .format("ScanEventJaxb [event=%s, eventKey=%s, ticket=%s, getToUserName()=%s, getFromUserName()=%s, getCreateTime()=%s, getMsgType()=%s]",
                        event, eventKey, ticket, getToUserName(), getFromUserName(), getCreateTime(), getMsgType());
    }
}
